'use strict';

const path = require('path');
const webpack = require('webpack');

module.exports = {
    mode: 'development',
    entry: {
        "app": './src/index.js',
        "search": "./src/search.js"
    },
    output: {
        path: path.join(__dirname, 'dist'),
        filename: '[name].js'
    },
    module: {
        rules: [
            {
                test: /.js$/,
                use: 'babel-loader'
            },
            {
                test: /.css$/,
                use: [
                    "style-loader",
                    "css-loader"
                ]
            },
            {
                test: /.(png|jpg|gif|jpeg|woff|woff2|eot|tff)$/,
                use: {
                    "loader": 'url-loader',
                    "options": {
                        limit: 10240
                    }
                }
            }
        ]
    },
    plugins: [
        new webpack.HotModuleReplacementPlugin()
    ],
    devServer: {
        contentBase: './dist',
        hot: true
    }
}